package com.hna.eking.Controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 
 *  视图控制类
 * <p>Date : 2013-4-17</p>
 * <p>Module : </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright &copy; 2013</p>
 * <p>Company :neusoft</p>
 * 
 * @author , BD&PRC
 * @version  V1.0
 * <p>------------------------------------------------------------</p>
 * <p> 修改历史</p>
 * <p> 序号 日期 修改人 修改原因</p>
 * <p> 1 </p>
 */
@Controller
@RequestMapping("/viewsmanagement/*")
public class ViewsController {
	
	
    @ResponseBody
    @RequestMapping("globalStatistics")
    public Model globalStatistics(HttpServletRequest request,Model model) {
    	String ip = request.getHeader("x-forwarded-for");
    	if(ip == null || ip.length() == 0 || ip.equalsIgnoreCase("unknown")){
    		ip= request.getHeader("Proxy-Client-IP");
    	}
		if(ip == null || ip.length() == 0 || ip.equalsIgnoreCase("unknown")){
			ip= request.getHeader("WL-Proxy-Client-IP");		
		}
		if(ip == null || ip.length() == 0 || ip.equalsIgnoreCase("unknown")){
			ip= request.getRemoteAddr();
		}
		model.addAttribute("ip", ip);
		return model;
    }
    
  
    @RequestMapping("UploadImage")
    public String UpLoadImageCtl(HttpServletRequest request,Model model) {
    	
		return "UploadImage";
    }
    
    
   
    
}
